﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="CustomerMgmView.aspx.cs" Inherits="Skynet.WebSite.Administracion.CustomersMgmView" %>
<%@ Register assembly="Microsoft.Practices.Web.UI.WebControls" namespace="Microsoft.Practices.Web.UI.WebControls" tagprefix="pp" %>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">               
         <table>           
                <tr>
                    <td colspan="2">                
                        <div style="height:85px; display:list-item"> 
                            <asp:ListView runat="server" DataSourceID="odsUsuarios" DataKeyNames="Id" 
                                ViewStateMode="Disabled" ID="lvCustomers"  
                                onselectedindexchanged="lvCustomers_SelectedIndexChanged"  >
                                <LayoutTemplate>
                                    <ul style=" display:inline; float:left;  margin-left:15px;  margin-bottom:15px; height:150px;"  >
                                        <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
                                    </ul>
                                </LayoutTemplate>
                                <ItemTemplate>
                                    <li>
                                        <fieldset>                                            
                                            <legend><%# Eval("Name") %></legend>
                                            Name : <%# Eval("Name") %> <br />
                                            Last Name : <%# Eval("LastName")%><br />
                                            <asp:LinkButton ID="LinkButton1" Text="Delete" CommandName="Delete" OnClientClick="return confirm('Delete this?');" runat="server" /> <br />
                                            <asp:LinkButton ID="LinkButton2" Text="Select" CommandName="select" CommandArgument="Id" runat="server" />                                            
                                        </fieldset>
                                    </li>
                                </ItemTemplate>
                                <EmptyDataTemplate>
                                    <div>
                                        No data
                                    </div>
                                </EmptyDataTemplate>
                            </asp:ListView>
                            <asp:DataPager  runat="server" ID="CustomerPager" PagedControlID="lvCustomers" 
                                PageSize="1" >
                                <Fields>
                                    <asp:NextPreviousPagerField />
                                </Fields>
                            </asp:DataPager>
                        </div>
                             <asp:ObjectDataSource ID="odsUsuarios" runat="server" 
                               ViewStateMode="Disabled"
                                OldValuesParameterFormatString="original_{0}" SelectMethod="GetUsuarios"   
                                TypeName="Skynet.WebAdministracion.Views.CustomersMgm.CustomerMgmPresenter" 
                                DataObjectTypeName="Skynet.BusinessEntities.Customer" 
                                InsertMethod="Add" DeleteMethod="Delete" UpdateMethod="Update">
                                </asp:ObjectDataSource>                
            </td>
        </tr>
        <tr>
            <td>
                            <asp:DetailsView ID="DetailsView1" runat="server"  AutoGenerateRows="true"
                            DataSourceID="odsWorkUsuario" Height="50px" Width="125px"  DataKeyNames="Id"
                            DefaultMode="Insert">
                            <Fields>                                
                                <asp:CommandField ShowEditButton="True" ShowInsertButton="True" />
                            </Fields>
                            </asp:DetailsView>
                            <asp:ObjectDataSource ID="odsWorkUsuario" runat="server" 
                            OldValuesParameterFormatString="original_{0}" SelectMethod="GetUsuario"   
                            TypeName="Skynet.WebAdministracion.Views.CustomersMgm.CustomerMgmPresenter" 
                            DataObjectTypeName="Skynet.BusinessEntities.Customer"
                            InsertMethod="Add" DeleteMethod="Delete" UpdateMethod="Update">
                             <SelectParameters>
                                 <asp:ControlParameter ControlID="lvCustomers" DbType="Guid" Name="Id" 
                                     PropertyName="SelectedValue" />
                             </SelectParameters>
                            </asp:ObjectDataSource>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td>                  
            </td>
            <td>                    
            </td>
        </tr>
    </table>
   
    
</asp:Content>
